﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Data.Extensions;
using ModernChannel.Configuration;
using ModernChannel.Model.Model;

namespace ModernChannel.Data.DBConfig
{
    public class OrderConfiguration : DBConfig<OrderInfo>
    {
        public OrderConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(k => new { k.InvOrg, k.ShiptoCode, k.OrderNo, k.LineNo, k.OrderQty, k.ReleaseQty, k.RequestArrivalDate, k.Model, k.Suffix });
            Property(c => c.UniqueId).IsRequired();
            Property(c => c.OrderNo).HasMaxLength(12).IsRequired();
            Property(c => c.InvOrg).HasMaxLength(3).IsRequired();
        }
    }
}
